<html>
<head><meta charset="utf-8"><title>compiler warnings · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/compiler.20warnings.html">compiler warnings</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="152682183"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/compiler%20warnings/near/152682183" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/compiler.20warnings.html#152682183">(Dec 29 2018 at 00:48)</a>:</h4>
<p>I found a lot of warnings while compiling rustc recently. Are we planning to remove the warnings in the future or is this an issue with my build environment ? </p>
<div class="codehilite"><pre><span></span>warning: unnecessary `unsafe` block
    --&gt; src/libcore/ptr.rs:2785:18
     |
2785 |             Some(unsafe { Unique { pointer: ptr as _, _marker: PhantomData } })
     |                  ^^^^^^ unnecessary `unsafe` block

warning: unnecessary `unsafe` block
    --&gt; src/libcore/ptr.rs:2841:9
     |
2841 |         unsafe { Unique { pointer: reference as *mut T, _marker: PhantomData } }
     |         ^^^^^^ unnecessary `unsafe` block

warning: unnecessary `unsafe` block
    --&gt; src/libcore/ptr.rs:2848:9
     |
2848 |         unsafe { Unique { pointer: reference as *const T, _marker: PhantomData } }
     |         ^^^^^^ unnecessary `unsafe` block

warning: unnecessary `unsafe` block
    --&gt; src/libcore/ptr.rs:2855:9
     |
2855 |         unsafe { Unique { pointer: p.pointer, _marker: PhantomData } }
     |         ^^^^^^ unnecessary `unsafe` block

warning: unnecessary `unsafe` block
    --&gt; src/libcore/ptr.rs:3044:9
     |
3044 |         unsafe { NonNull { pointer: unique.pointer } }
     |         ^^^^^^ unnecessary `unsafe` block

warning: unnecessary `unsafe` block
    --&gt; src/libcore/ptr.rs:3052:9
     |
3052 |         unsafe { NonNull { pointer: reference as *mut T } }
     |         ^^^^^^ unnecessary `unsafe` block

warning: unnecessary `unsafe` block
    --&gt; src/libcore/ptr.rs:3060:9
     |
3060 |         unsafe { NonNull { pointer: reference as *const T } }
     |         ^^^^^^ unnecessary `unsafe` block

warning: unused attribute
</pre></div>



<a name="152699341"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/compiler%20warnings/near/152699341" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/compiler.20warnings.html#152699341">(Dec 29 2018 at 10:02)</a>:</h4>
<p>These only happen on stage 0 because the bootstrap compiler is too old. We should make this clearer somehow</p>



<a name="152707743"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/compiler%20warnings/near/152707743" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/compiler.20warnings.html#152707743">(Dec 29 2018 at 15:22)</a>:</h4>
<blockquote>
<p>These only happen on stage 0 because the bootstrap compiler is too old. We should make this clearer somehow</p>
</blockquote>
<p>Thanks <span class="user-mention" data-user-id="124288">@Oli</span> . That makes sense</p>



<a name="157939421"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/compiler%20warnings/near/157939421" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/compiler.20warnings.html#157939421">(Feb 09 2019 at 18:04)</a>:</h4>
<p>I'm getting this ...</p>



<a name="157939463"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/compiler%20warnings/near/157939463" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/compiler.20warnings.html#157939463">(Feb 09 2019 at 18:04)</a>:</h4>
<div class="codehilite"><pre><span></span>error: unnecessary `unsafe` block=============&gt;                        ] 21/36: core
    --&gt; src/libcore/mem.rs:1091:9
     |
1091 |         unsafe {
     |         ^^^^^^ unnecessary `unsafe` block
     |
     = note: `-D unused-unsafe` implied by `-D warnings`

error: aborting due to previous error

error: Could not compile `core`.
</pre></div>



<a name="157939465"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/compiler%20warnings/near/157939465" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/compiler.20warnings.html#157939465">(Feb 09 2019 at 18:04)</a>:</h4>
<p>can't compile</p>



<a name="157939666"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/compiler%20warnings/near/157939666" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/compiler.20warnings.html#157939666">(Feb 09 2019 at 18:10)</a>:</h4>
<p>The lint warnings are made errors by the <code>-D</code> flags.</p>



<a name="157939669"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/compiler%20warnings/near/157939669" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/compiler.20warnings.html#157939669">(Feb 09 2019 at 18:10)</a>:</h4>
<p>libcore/libstd must not have any warnings to compile</p>



<a name="157939682"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/compiler%20warnings/near/157939682" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/compiler.20warnings.html#157939682">(Feb 09 2019 at 18:11)</a>:</h4>
<p>I remember a PR that changed something somewhere in that area, but I don’t recall that landing</p>



<a name="157978238"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/compiler%20warnings/near/157978238" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/compiler.20warnings.html#157978238">(Feb 10 2019 at 14:58)</a>:</h4>
<p>I’m getting that with current master, just in case going to try pulling again</p>



<a name="157978266"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/compiler%20warnings/near/157978266" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/compiler.20warnings.html#157978266">(Feb 10 2019 at 14:59)</a>:</h4>
<p>otherwise is there a way to turn that off for my runs of <code>./x.py</code>?</p>



<a name="157978319"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/compiler%20warnings/near/157978319" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/compiler.20warnings.html#157978319">(Feb 10 2019 at 15:00)</a>:</h4>
<p>I’m working on something completely unrelated</p>



<a name="158536096"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/compiler%20warnings/near/158536096" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/compiler.20warnings.html#158536096">(Feb 14 2019 at 15:09)</a>:</h4>
<p>I'm getting errors when compiling master, too</p>



<a name="158536111"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/compiler%20warnings/near/158536111" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/compiler.20warnings.html#158536111">(Feb 14 2019 at 15:09)</a>:</h4>
<p>do these not get blocked from passing on Travis?</p>



<a name="158536131"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/compiler%20warnings/near/158536131" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/compiler.20warnings.html#158536131">(Feb 14 2019 at 15:10)</a>:</h4>
<p>I had an error recently, doing a clean fixed it. Still get the occasional warning for some crates.</p>



<a name="158536450"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/compiler%20warnings/near/158536450" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/compiler.20warnings.html#158536450">(Feb 14 2019 at 15:13)</a>:</h4>
<p>I'll try that — it's not the sort of issue I've seen arising from non-clean builds before</p>



<a name="158536590"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/compiler%20warnings/near/158536590" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/compiler.20warnings.html#158536590">(Feb 14 2019 at 15:14)</a>:</h4>
<p>Looking through my old scrollback, looks like it was this error that I got on stage1 codegen artifacts: </p>
<div class="codehilite"><pre><span></span>error[E0460]: found possibly newer version of crate `std` which `cc` depends on rustc-demangle, cc, num_cpus, memmap, rustc_llvm(build.rs)
   --&gt; src/librustc_llvm/build.rs:126:19
    |
126 |     let mut cfg = cc::Build::new();
    |                   ^^
    |
    = note: perhaps that crate needs to be recompiled?
    = note: the following crate versions were found:
            crate `std`: /home/david/projects/rust/workdirs/rust4/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-be1ed48da452ee8b.rlib
            crate `std`: /home/david/projects/rust/workdirs/rust4/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-be1ed48da452ee8b.so
            crate `cc`: /home/david/projects/rust/workdirs/rust4/build/x86_64-unknown-linux-gnu/stage1-codegen/release/deps/libcc-f2605550c49bbccb.rlib
</pre></div>



<a name="158536634"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/compiler%20warnings/near/158536634" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/compiler.20warnings.html#158536634">(Feb 14 2019 at 15:15)</a>:</h4>
<p>ah, yes, those do often pop up from not cleaning</p>



<a name="158536651"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/compiler%20warnings/near/158536651" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/compiler.20warnings.html#158536651">(Feb 14 2019 at 15:15)</a>:</h4>
<p>the error I got was a warning that was <code>#[deny]</code>'d</p>



<a name="158536774"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/compiler%20warnings/near/158536774" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/compiler.20warnings.html#158536774">(Feb 14 2019 at 15:16)</a>:</h4>
<p>Something like that rings a bell too but I none of my scrollback goes back far enough to check.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>